<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
    <%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags"%>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<jsp:include page="/common/commonCss.jsp"/>
<jsp:include page="/common/commonJs.jsp"/>
<script src="${basePath }commonJs/tags/My97DatePicker/WdatePicker.js"></script>
<title>嘉童游乐中心-新增付款订单清单</title>

	<SCRIPT type="text/javascript">
		 
	var pkPayFormId ='${pkPayFormId}';
	$(document).ready(function(){
		purOrderPrdDiv('');
	});
	var pStatusName=new Array("未到货","部分到货","全部到货");
	function purOrderPrdDiv(divType){//采购商品目录 列表
	     var url="${basePath }scmInvocing/scmPayForm/scmPurOrderListByPayFormId.shtml?pkPayFormId="+pkPayFormId;
			$.ajax({
				   url: url,
				   type: 'get',
				      async:false, 
				      success:function(data){
							if (data != null) {
								var jsonarray ;
								 for(var o in data){  
									 if(o=="scmPurOrderList"){
										 jsonarray=data[o];
										 var html='<tr><th>序号</th><th>采购订单编号</th><th>商品分类</th><th>到货状态</th></tr>';
										 if(jsonarray!=null && jsonarray.length>0){
										 for (var k = 0; k < jsonarray.length; k++) {
												  var jsonobj = jsonarray[k];
										   if(jsonobj!=null){
											 var deliveryStatus =jsonobj["deliveryStatus"];
											 var deliveryName ="";
											 if(deliveryStatus!=null){
												 var deliveryStatusValue =parseInt(deliveryStatus)-1;
												 deliveryName =pStatusName[deliveryStatusValue];
											 }
											
											   
										      var pkPurordId=jsonobj["pkPurordId"];
										      var pCateName =jsonobj["pCateName"];
												 //===
						                               html+='<td>'+(k+1)+'</td>';
						                                html+='<td>'+pkPurordId+'</td>';
						                                html+='<td>'+pCateName+'</td>';
						                                html+='<td>'+deliveryName+'</td> ';
													var delpurPrd ="del_purOrderId('"+pkPurordId+"')";
												 //===
												 html+="</tr>";
										  }
										 }   
										 }
										 $("#tablesupPrd").html(html);
									 } 
									
									
								 }
								
								 //initpriceSupRrd();//初始化 供应商 协议价格，协议id 
								 
							}else{
								 $.messager.alert('提示','添加采购商品失败！','error');
							}
							 
					   }
			 });
	}
		

	</SCRIPT>
</head>
<body class="bg">
<div class="content m_auto">
	<div class="content_l mt10">
    	<ul>
        	         <shiro:hasPermission name="scmInvocing/productInfo/forwardToProductInfo.shtml">
    				  <li><a href="${basePath}scmInvocing/productInfo/forwardToProductInfo.shtml"><i class="nav_icon_b"></i><br>商品信息</a></li>
    		</shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/countUnit/forwardToUnitInfo.shtml">
    		 		<li><a href="${basePath}scmInvocing/countUnit/forwardToUnitInfo.shtml"><i class="nav_icon_b"></i><br>单位设置</a></li>
    		 </shiro:hasPermission>
    		 <shiro:hasPermission name="scmInvocing/supplier/forwardToSupply.shtml">
    		 		   <li><a href="${basePath}scmInvocing/supplier/forwardToSupply.shtml"><i class="nav_icon_a"></i><br>供应商信息</a></li>
    		 </shiro:hasPermission>
    		  <shiro:hasPermission name="scmInvocing/priceManager/forwardToList.shtml">
    		 		  <li><a href="${basePath}scmInvocing/priceManager/forwardToList.shtml"><i class="nav_icon_f"></i><br>价格管理</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPurOrder/findInvoPurOrder.shtml">
            	  <li><a href="${basePath}scmInvocing/scmPurOrder/findInvoPurOrder.shtml"><i class="nav_icon_b"></i><br>采购订单</a></li>
    		 </shiro:hasPermission>
    		   <shiro:hasPermission name="scmInvocing/scmPayForm/findInvoOrderPay.shtml">
           		   <li  class="content_hover"><a href="${basePath}scmInvocing/scmPayForm/findInvoOrderPay.shtml"><i class="nav_icon_b"></i><br>付款申请</a></li>
    		 </shiro:hasPermission></ul>
    </div>
    <div class="content_r mt10">
    	<div class="p20">
            <div class="file_single_dl f14 fixed">
                <h1 class=""><font size="+1">付款订单清单</font></h1>
                <hr>
                <dl class="fixed" style="overflow:hidden"> 
                    <dd><label>付款申请编号：</label>${pkPayFormId}</dd>
               		<dd><label>申请人：</label>${userName}</dd>
               		<dd><label>申请门店：</label>${brandName}</dd>
                </dl>
                <hr>
	    	<dl  class="fixed" style="overflow:hidden">
	    	     <dd><label>供应商：</label> ${brandName}
                         </dd>
             </dl>
                <hr>
            </div>
           
            <div class="mt10">
                <h1 class=""><font size="+1">采购商品目录</font></h1>
                          <table class="table" id="tablesupPrd">
                      
                           
                            
                        </table>
				<dl class="fixed order_dl"   >
                    	<dd><label><b>处理历史：</b></label>
                 	<dd>
                            <table class="table" >
                                <tr>
                                    <th>时间</th>
                                    <th>处理人</th>
                                    <th>结果</th>
                                    <th>处理意见</th>
                                </tr>
                                 <c:forEach items="${hisWorkFlowList }" var="hisEntity" >
			                        <tr>
	                                    <td style="width:40%">${hisEntity.optTime }</td>
	                                    <td>${hisEntity.optName }</td>
	                                    <td>${hisEntity.result }</td>
	                                    <td title="${hisEntity.advice}">
		                                 <c:if test="${hisEntity.advice != null}">
		                                   	<c:choose>
		                                   		<c:when test="${hisEntity.advice.length()>40}">
		                                   			${hisEntity.advice.substring(0,40)}...
		                                  		 </c:when>
		                                   		<c:otherwise>
		                                    	${hisEntity.advice }
		                                   		</c:otherwise>
		                                    </c:choose>
	                                    </c:if>
	                                    </td>
	                                </tr>
		                        </c:forEach>
                            </table>
                        </dd>
             
                      
            </dl>
				<div class="btm_btn ">
                            <dl>
                              <dd><input class="btn" type="button" value="返回" onClick="javascript:window.location.href='${basePath}scmInvocing/scmPayForm/findInvoOrderPay.shtml'"></dd>
                               <dd><input class="btn" type="button" value="打印" ></dd>
                                
                            </dl>
                        </div>
            </div>
        </div>
    </div>
</div> 
</body>
</html>